home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ply15dat.zip / MAP1.PI < prev    next >
Text File  |  1992-09-19  |  2KB  |  76 lines

  1. // Sample file demonstrating the mapping of an image onto a box
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. viewpoint {
  5.    from <0,3,-10>
  6.    at <0,0,5>
  7.    up <0,1,0>
  8.    angle 45
  9.    resolution 160, 160
  10.    }
  11.  
  12. // Get various surface finishes
  13. include "..\colors.inc"
  14.  
  15. // Set up background color & lights
  16. background <0, 0, 0>
  17. light white, <10, 5, -50>
  18.  
  19. // Pull in a Targa file
  20. define ball_image image("m22u.tga")
  21. define box_image_texture
  22. texture {
  23.    special surface {
  24.       color planar_imagemap(ball_image, P, 1)
  25.       ambient 0.2
  26.       diffuse 0.8
  27.       }
  28.    }
  29.  
  30. define ball_image_texture
  31. texture {
  32.    special surface {
  33.       color spherical_imagemap(ball_image, P)
  34.       ambient 0.2
  35.       diffuse 0.8
  36.       }
  37.    }
  38.  
  39. define can_image_texture
  40. texture {
  41.    special surface {
  42.       color cylindrical_imagemap(ball_image, P, 1)
  43.       ambient 0.2
  44.       diffuse 0.8
  45.       }
  46.    }
  47.  
  48. define basic_box object { box <-2, 0, -2>, <2, 1, 2> }
  49.  
  50. basic_box {
  51.    box_image_texture { scale <2, 1, 2> }
  52.    rotate <-30, 30, 0>
  53.    translate <1, 0, -1>
  54.    }
  55.  
  56. object {
  57.    sphere <0, 0, 0>, 1
  58.    ball_image_texture
  59.    rotate <30, 45, 0>
  60.    translate <0, 3, 0>
  61.    }
  62.  
  63. object {
  64.    cylinder <0, 0, 0>, <0, 3, 0>, 1
  65.    can_image_texture { rotate <0, 180, 0> } // { scale <1, 3, 1> }
  66.    translate <-3, 0, 1>
  67.    }
  68.  
  69. // Create a ground plane
  70. object {
  71.    disc <0, -0.001, 0>, <0, 1, 0>, 0, 1000
  72.    texture { checker matte_white, matte_black }
  73.    scale <10, 10, 10>
  74.    translate <0,-0.01,0>
  75.    }
  76.